﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace CodeGenerate
{
    [ServiceContract]
    public interface IDataBase
    {
        /// <summary>
        /// 获取所有的数据表，视图，存储过程对象
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        [OperationContract]
        List<Table> GetObjects(ObjectType type);

        /// <summary>
        /// 获取指定表列
        /// </summary>
        /// <param name="tableName"></param>
        /// <returns></returns>
        [OperationContract]
        List<Column> GetColumns(string tableName);


        /// <summary>
        /// 获取指定视图列
        /// </summary>
        /// <param name="tableName"></param>
        /// <returns></returns>
        [OperationContract]
        List<Column> GetViewColumns(string viewName);         


        /// <summary>
        /// 获取存储过程参数
        /// </summary>
        /// <param name="procName"></param>
        /// <returns></returns>
        [OperationContract]
        List<StoredProcedureParam> GetParas(string procName);

        /// <summary>
        /// 生成所有的数据实体
        /// 表中列
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateAllModel();

        /// <summary>
        /// 生成所有的存储过程
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateAllProc();

        /// <summary>
        /// 生成所有的表,视图,存储过程结构体
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateAllStruct();


        [OperationContract]
        string CreateAspx(Table table);

        [OperationContract]
        string CreateAspxEdit(Table table,List<Column> columns);

        [OperationContract]
        string CreateAspxList(Table table, List<Column> columns);

        [OperationContract]
        string CreateAspxQuery(Table table, List<Column> columns);

        [OperationContract]
        string CreateAspxInfo(Table table, List<Column> columns);


        [OperationContract]
        string CreateAspxCs(Table table);

        [OperationContract]
        string CreateAspxCsEdit(Table table, List<Column> columns);

        [OperationContract]
        string CreateAspxCsQuery(Table table, List<Column> columns);

        [OperationContract]
        string CreateAspxCsInfo(Table table, List<Column> columns);

        /// <summary>
        /// aspx.cs Save
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateAspxCsSave(Table table, List<Column> columns);

        /// <summary>
        /// BussinessImplement层主体
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateBussinessImplement(Table table);

        /// <summary>
        /// Service 层 CommandObject
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateServiceCmdObject(Table table, List<Column> columns);

        /// <summary>
        /// Service层 分页
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateServicePageList(Table table, List<Column> columns);


        /// <summary>
        /// DataContract
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateDataContract(Table table, List<Column> columns);

        /// <summary>
        /// DataExchange
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string CreateDataExchange(Table table, List<Column> columns);

        /// <summary>
        /// aspx.designer.cs
        /// </summary>
        /// <param name="table"></param>
        /// <param name="columns"></param>
        /// <returns></returns>
        [OperationContract]
        string CreateAspxDesignerCs(Table table, List<Column> columns);


        /// <summary>
        /// service contract
        /// </summary>
        /// <param name="table"></param>
        /// <param name="columns"></param>
        /// <returns></returns>
        [OperationContract]
        string CreateServiceContract(Table table, List<Column> columns);

        /// <summary>
        /// service Implement
        /// </summary>
        /// <param name="table"></param>
        /// <param name="columns"></param>
        /// <returns></returns>
        [OperationContract]
        string CreateServiceImplement(Table table, List<Column> columns);


        /// <summary>
        /// CoreService
        /// </summary>
        /// <param name="table"></param>
        /// <param name="columns"></param>
        /// <returns></returns>
        [OperationContract]
        string CreateCoreService(Table table);


        /// <summary>
        /// Ioc Config
        /// </summary>
        /// <param name="table"></param>
        /// <param name="columns"></param>
        /// <returns></returns>
        [OperationContract]
        string CreateIocConfig(Table table);


        /// <summary>
        /// 获取文件名称
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        [OperationContract]
        string GetCodeFileName(string tableName, PageType type);

        /// <summary>
        /// BussinessName(Framework/IRP/Demo)
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetBussinessName();


        [OperationContract]
        List<CodeModel> GetModels();
      
    }
}
